package kr.hkit.powerjava.chapter12.work;

public class Person implements Comparable<Person>{
	private String name;
	private int height;
	
	
	public Person(String name, int height) {
		super();
		this.name = name;
		this.height = height;
	}
	
	public Person(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public int getHeight() {
		return height;
	}


	public void setHeight(int height) {
		this.height = height;
	}


	@Override
	public int compareTo(Person o) {
		return height - o.height;
	}


	@Override
	public String toString() {
		return "Person [name=" + name + ", height=" + height + "]";
	}

	@Override
	public int hashCode() {
		
		return this.name.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		
		return name.equals(((Person)obj).name);
	}
	

	
	
}

